package com.tuo51.liveroom.domains;

import com.tuo51.foudation.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@Table(name = "l_liveroom")
public class LiveRoom extends Model {

    @Column(columnDefinition = " varchar(50) COMMENT '摄像头名称' ")
    private String name;

    @Column(columnDefinition = " varchar(255) COMMENT '直播地址' ")
    private String url; //直播地址

    @Column(name = "orgId")
    private String orgId;

    @Column(name = "createTime")
    private Date created;

    @Column(columnDefinition = "int default 1")
    private Integer type = 1;

    @Column(columnDefinition = " varchar(255) COMMENT '高清播放地址' ")
    private String hdURL;

    @Column(columnDefinition = " varchar(255) COMMENT '预览图地址' ")
    private String thumbURL;//预览图地址

    @Column(columnDefinition = " varchar(32) COMMENT '教学区域id' ")
    private String teachingAreaId;

    @Column(columnDefinition = "bit default 1")
    private Boolean active = true;//是否可用

    //新增字段
    @Column(columnDefinition = " varchar(32) COMMENT '录像机序列号' ")
    private String deviceSerial;//  录像机序列号

    @Column(columnDefinition = " int(11) COMMENT '通道号' ")
    private Integer channelNo ;    //通道号

    @Column(columnDefinition = " varchar(255) COMMENT 'HLS流畅直播地址' ")
    private String hls;    //HLS流畅直播地址

    @Column(columnDefinition = " varchar(255) COMMENT 'HLS高清直播地址' ")
    private String hlsHd;    //HLS高清直播地址

    @Column(columnDefinition = " int default 0 COMMENT '地址使用状态' ")
    private Integer status = 0;    // 地址使用状态


    @Column(columnDefinition = " varchar(500) default '[\"00:00-23:59\"]' COMMENT '此摄像头开放时间段' ")
    private String openTime = "[\"00:00-23:59\"]";

    @Column(columnDefinition = "int(11) default 2 comment '直播方式 2 RTMP ,1 EZOPEN'")
    private Integer liveWay = 2;

    @Column(columnDefinition = "varchar(10) default 'RTMP' comment '直播方式 RTMP (默认) EZOPEN'")
    private String liveWayVal = "RTMP";

}
